<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
	<p:layout fullPage="true">
		<p:layoutUnit style="width: auto" position="west" header="ADS Tree" resizable="true"
			closable="true" collapsible="true">
			<p:tabView id="tabView">
				<p:tab title="Ads Structure">
					<h:form id="form">
						<p:contextMenu for="ldapTree">
							<p:menuitem value="Create" update="ldapTree" icon="ui-icon-close">
								<f:setPropertyActionListener value="#{true}"
									target="#{requestScope.renderCampNou}" />
							</p:menuitem>
						</p:contextMenu>
						<p:tree style="width: auto" id="ldapTree" dynamic="true" cache="true"
							selection="#{ldapTreeBean.selectedNode}" selectionMode="single"
							value="#{ldapTreeBean.root}" var="node">

							<p:ajax event="select" update=":userview, :groupview"
								listener="#{ldapTreeBean.onNodeSelect}" />
							<p:ajax event="expand" listener="#{ldapTreeBean.onNodeExpand}" />

							<p:treeNode id="treeNode">
								<h:outputText value="#{node}" id="lblNode" />
							</p:treeNode>
						</p:tree>

					</h:form>
				</p:tab>
				<p:tab title="Member-Tree">
					<h:form>
						<p:contextMenu for="ldapGroupTree">
							<p:menuitem value="Create" update="ldapGroupTree" icon="ui-icon-close">
								<f:setPropertyActionListener value="#{true}"
									target="#{requestScope.renderCampNou}" />
							</p:menuitem>
						</p:contextMenu>
						<p:tree style="width: auto" id="ldapGroupTree" dynamic="true" cache="true"
							selection="#{ldapGroupBean.selectedNode}" selectionMode="single"
							value="#{ldapGroupBean.root}" var="group">

							<p:ajax event="select" update=":userview, :groupview"
								listener="#{ldapGroupBean.onNodeSelect}" />
							<p:ajax event="expand" listener="#{ldapGroupBean.onNodeExpand}" />

							<p:treeNode id="treeNode">
								<h:outputText value="#{group}" id="lblNode" />
							</p:treeNode>
						</p:tree>
					</h:form>
				</p:tab>
					<p:tab title="Member-Of Tree">
					<h:form>
						<p:contextMenu for="ldapUserTree">
							<p:menuitem value="Create" update="ldapUserTree" icon="ui-icon-close">
								<f:setPropertyActionListener value="#{true}"
									target="#{requestScope.renderCampNou}" />
							</p:menuitem>
						</p:contextMenu>
						<p:tree style="width: auto" id="ldapUserTree" dynamic="true" cache="true"
							selection="#{ldapUserBean.selectedNode}" selectionMode="single"
							value="#{ldapUserBean.root}" var="user">

							<p:ajax event="select" update=":userview, :groupview"
								listener="#{ldapUserBean.onNodeSelect}" />
							<p:ajax event="expand" listener="#{ldapUserBean.onNodeExpand}" />

							<p:treeNode id="treeNode">
								<h:outputText value="#{user}" id="lblNode" />
							</p:treeNode>
						</p:tree>
					</h:form>
				</p:tab>
			</p:tabView>
		</p:layoutUnit>
		<p:layoutUnit  position="center" resizable="true" id="center"
			closable="true" collapsible="true" effect="drop">
			<ui:include src="views/user.xml" />
			<ui:include src="views/group.xml" />
		</p:layoutUnit>

	</p:layout>
</h:body>
</html>